<!DOCTYPE HTML>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="author" content="Bootstrap-ecommerce by Vosidiy">

    <title>【管理员】酒店列表</title>

    <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico">

    <!-- jQuery -->
    <script src="/js/jquery-2.0.0.min.js" type="text/javascript"></script>

    <!-- Bootstrap4 files-->
    <script src="/js/bootstrap.bundle.min.js" type="text/javascript"></script>
    <link href="/css/bootstrap.css" rel="stylesheet" type="text/css"/>

    <!-- Font awesome 5 -->
    <link href="/fonts/fontawesome/css/fontawesome-all.min.css" type="text/css" rel="stylesheet">

    <!-- plugin: fancybox  -->
    <script src="/plugins/fancybox/fancybox.min.js" type="text/javascript"></script>
    <link href="/plugins/fancybox/fancybox.min.css" type="text/css" rel="stylesheet">

    <!-- custom style -->
    <link href="/css/ui.css" rel="stylesheet" type="text/css"/>
    <link href="/css/responsive.css" rel="stylesheet" media="only screen and (max-width: 1200px)" />

    <!-- custom javascript -->
    <script src="/js/script.js" type="text/javascript"></script>

    <script type="text/javascript">
        /// some script

        // jquery ready start
        $(document).ready(function() {
            // jQuery code

        });
        // jquery end

        //悬浮提示
        $(function () { $("[data-toggle='tooltip']").tooltip(); });
    </script>

</head>
<body>
<nav class="navbar navbar-expand-lg navbar-collapse  bg2">
    <form action="/HTML/userInfo" method="post" name="showUserInfoForm" >
        <a class="navbar-brand" href="javascript:history.go(-1)" name="savesubmit" id="savesubmit"> <img class="logo" src="/images/logo-dark.png" th:text="'  '+'管理员 · 用户订单列表'"></a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar1" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
    </form>
    <div class="collapse navbar-collapse " id="navbar1" >
        <ul class="navbar-nav ml-auto">
            <li class="nav-item">
                <a class="btn ml-2 btn-outline-danger" href="/HTML/relogin">退出登录<span class="sr-only">(current)</span></a>
            </li>
            <!--<a class="btn ml-2 btn-outline-success" href="/HTML/adminHome">返回主页</a>-->
            <form action="/HTML/searchUser" method="post" name="searchUser" >
                <button class="btn ml-2 btn-outline-danger" type="submit">用户列表<span class="sr-only"></span></button>
            </form>
            <form action="/HTML/adminShowOrderList" method="post" name="searchUser" >
                <button class="btn ml-2 btn-outline-primary" type="submit">订单列表<span class="sr-only"></span></button>
            </form>
        </ul>
    </div>
</nav>

<div >
    <p class="alert alert-success">
        点击酒店号，可以更改对应酒店的信息。点击酒店中文名，可以去往酒店主页。
    </p>
</div> <!-- card.// -->

<div class="card">
    <table class="table table-hover shopping-cart-wrap">
        <thead class="text-muted">
        <tr>
            <th>酒店号</th>
            <th >酒店名字</th>
            <th width="100">城市</th>
            <th width="300">位置</th>
            <th>星级</th>
            <th>房间数</th>
            <th>层数</th>
            <th>开业时间</th>
            <th>装修时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        <tr th:each="hotel: ${hotels}">
            <td>
                <form action="/HTML/showHotelForAdmin" method="post" >
                    <div class="price-wrap">
                        <input type="hidden" name="hotelId" id="hotelId" th:value="${hotel.hotelId}" >
                        <button class="btn btn-outline-primary" type="submit"
                                data-toggle="tooltip" data-placement="top" title="点击酒店号号更改酒店"
                                th:text="${hotel.hotelId}"></button>
                    </div> <!-- price-wrap .// -->
                </form>
            </td>
            <td>
                <!--<div class="price-wrap"><var class="" th:text="${hotel.hotelTranslatedName}"></var></div> &lt;!&ndash; price-wrap .// &ndash;&gt;-->
                <div>
                    <a class="text-primary" th:text="${hotel.hotelTranslatedName}" th:href="${hotel.url}"></a>
                    <br>
                    <span th:text="${hotel.hotelName}"></span>
                </div>
            </td>
            <td >
                <div class="price-wrap"><var class="" th:text="${hotel.country}+' · '+${hotel.city}"></var></div>
            </td>
            <td>
                <div class="price-wrap"><var class="" th:text="${hotel.addressline1}"></var></div>
            </td>
            <td>
                <div class="price-wrap"><var class="" th:text="${hotel.starRating}"></var></div> <!-- price-wrap .// -->
            </td>
            <td>
                <div class="price-wrap"><var class="" th:text="${hotel.numberrooms}"></var></div> <!-- price-wrap .// -->
            </td>
            <td>
                <div class="price-wrap"><var class="" th:text="${hotel.numberfloors}"></var></div> <!-- price-wrap .// -->
            </td>
            <td>
                <div class="price-wrap"><var class="" th:text="${hotel.yearopened}"></var></div> <!-- price-wrap .// -->
            </td>
            <td>
                <div class="price-wrap"><var class="" th:text="${hotel.yearrenovated}"></var></div> <!-- price-wrap .// -->
            </td>
            <td>
                <table>
                    <thead>
                    <tr>
                        <th>
                        <form action="/HTML/reHotelInfo" method="post" >
                            <input type="hidden" name="hotelId"  th:value="${hotel.hotelId}" >
                            <button  class="btn btn-outline-primary " type="submit">详情</button>
                        </form>
                        </th>
                        <th>
                        <form action="/HTML/adminDeleteHotel" method="post" >
                            <input type="hidden" name="hotelId"  th:value="${hotel.hotelId}" >
                            <button  class="btn btn-outline-danger " type="submit"
                                     th:onclick="return confirmDelectOrder()" >删除</button>
                        </form>
                        </th>
                    </tr>
                    </thead>
                </table>
            </td>
        </tr>

        </tbody>
    </table>
</div> <!-- card.// -->


<!-- ========================= SECTION CONTENT END// ========================= -->

<!-- ========================= FOOTER ========================= -->
<footer class="section-footer bg2">
    <div class="container">
        <section class="footer-bottom row">
            <div class="col-sm-6">
                <p> 四川大学实训项目 <br>  第六组作品</p>
            </div>
            <div class="col-sm-6">
                <p class="text-sm-right">
                    2019 · 7 · 8 <br>
                    中国 · 成都
                    <!--<a href="http://bootstrap-ecommerce.com">Bootstrap-ecommerce UI kit</a>-->
                </p>
            </div>
        </section> <!-- //footer-top -->
    </div><!-- //container -->
</footer>
<!-- ========================= FOOTER END // ========================= -->
<script>
    function confirmDelectOrder() {
        var r = confirm("此操作将删除此订单且不可复原，确定删除吗？")
        if(r==true){
            alert("删除成功");
            return true;
        }
        else{
            alert("取消删除");
            return false;
        }
    }
</script>

</body>
</html>